package com.leiyu.main

import com.jfinal.config._
import com.jfinal.core.JFinal
import com.jfinal.render.ViewType
import com.jfinal.template.Engine
import com.leiyu.control.IndexControl

/**
  * Created by LeiYu on 2017/6/26.
  */
class MainConfig extends JFinalConfig {
  override def configConstant(constants: Constants): Unit = {
    constants.setDevMode(true)

    constants.setViewType(ViewType.JSP)
  }

  override def configPlugin(plugins: Plugins): Unit = {}

  override def configEngine(engine: Engine): Unit = {}

  override def configHandler(handlers: Handlers): Unit = {}

  override def configInterceptor(interceptors: Interceptors): Unit = {}

  override def configRoute(me: Routes): Unit = {
    me.add("/", classOf[IndexControl])
  }
}


object MainConfig {
  def main(args: Array[String]): Unit = {
    JFinal.start("web", 8080, "/", 20)
  }
}